Skip to content

multikernel: support isolated SR-IOV VF assignment#4

Draft
nickolaev wants to merge 4 commits into
multikernel:masterfrom
nickolaev:sriov-vf-assignment
Draft

multikernel: support isolated SR-IOV VF assignment#4
nickolaev wants to merge 4 commits into
multikernel:masterfrom
nickolaev:sriov-vf-assignment

Conversation

@nickolaev

Copy link
Copy Markdown

Multikernel instances currently lack a complete PCI ownership model. A spawned
x86 kernel needs enough platform and device state to enumerate its assigned
device without exposing or disturbing devices retained by the primary kernel.

This series adds end-to-end assignment of an SR-IOV VF to a spawned kernel while
the primary retains the PF.

The series:

  1. Adds PCI devices, BARs, and host-bridge information to each Multikernel instance.
  2. Transfers and restores the x86 ECAM configuration needed by the secondary.
  3. Exposes only assigned PCI devices to the secondary and restores their identity and BARs.
  4. Keeps the secondary’s LAPIC timer active when the primary owns the platform timer.

The resulting ownership model is:

  • the primary kernel retains the PF;
  • the secondary sees only its assigned VF;
  • VF identity and BAR resources survive the handoff;
  • config accesses to unassigned functions do not reach hardware; and
  • Multikernel-specific policy remains outside the generic PCI probe path.

This work can be demonstrated using the main branch here https://codeberg.org/nickolaev/multikernel/src/branch/main .
It was not tested on real hardware, only with qemu-system-x86_64.

Keep assigned PCI devices and BAR metadata in each instance.

Carry PCI host-bridge descriptors through the device-tree transport.

This gives architecture code one owned source of assignment state.

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
Move ECAM restore and snapshot policy into arch/x86/multikernel.

Leave generic MMCONFIG with only a locked region visitor.

Use x86 platform callbacks so arch/x86/pci/init.c stays generic.

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
Filter root PCI config access in arch/x86/multikernel.

Synthesize assigned VF identity and restore BARs with a PCI header fixup.

Remove multikernel branches from drivers/pci/probe.c.

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
Keep spawned kernels from rejecting their calibrated LAPIC timer.

The host-owned platform timer cannot advance local jiffies.

Keep the policy in arch/x86/multikernel and one predicate in APIC code.

Signed-off-by: Nikolay Nikolaev <nicknickolaev@gmail.com>
@nickolaev
nickolaev force-pushed the sriov-vf-assignment branch from b715339 to 0ff04f5 Compare July 22, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant